package top.xia17.plugins.fast.common.database.redisson.lock;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.logging.LogLevel;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

/**
 * redisson分布式锁的全局配置
 * @author xia17
 * @date 2022/9/15
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "xia17fast.common.redisson.lock")
public class RedissonLockProperties {


    /** 名称前缀 */
    private String namePrefix = "rlock_";

    /** 锁被占用是否放弃 */
    private Boolean havaTry = false;

    /** 等待时间 */
    private Long waitTime = 5L;

    /** 锁占用的持续时间 */
    private Long leaseTime = 5L;

    /** 时间单位 */
    private TimeUnit timeUnit = TimeUnit.SECONDS;

    /** 日志级别，只支持 INFO 和 DEBUG */
    private LogLevel logLevel = LogLevel.INFO;




}
